/*
 * Project Name spring-boot-tools
 * File Name BatchSaveInjector
 * Package Name com.huxiaosu.tools.mybatis.injector
 * Create Time 2024/7/15
 * Create by name：liujie
 */
package com.huxiaosu.tools.mybatis.extend.injector;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn;
import com.github.yulichang.injector.MPJSqlInjector;

import java.util.List;

/**
 * 添加批量插入的 SQL 注入器
 *
 * @author liujie
 * @date 2024/7/15 15:21
 */
public class BatchSaveInjector extends MPJSqlInjector {
    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
        List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
        // add InsertBatchSomeColumn
        methodList.add(new InsertBatchSomeColumn());
        return methodList;
    }
}